package cn.cai.pethome.dept.service;

import cn.cai.pethome.PetHomeApp;
import cn.cai.pethome.base.util.MD5Utils;
import cn.cai.pethome.logininfo.domain.Logininfo;
import cn.cai.pethome.logininfo.service.ILogininfoService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = PetHomeApp.class)
public class logininfo {

    @Autowired
    private ILogininfoService logininfoService;

    @Test
    public void resultlogininfo() {


        Logininfo logininfo = logininfoService.findById(321L);
        String md5Password = MD5Utils.encrypByMd5("123" + logininfo.getSalt());
        logininfo.setPassword(md5Password);
        logininfoService.update(logininfo);
    }
}
